//
//  ZWToolHeader.h
//  TopicDemo
//
//  Created by InitialC on 16/11/23.
//  Copyright © 2016年 InitialC. All rights reserved.
//

#ifndef ZWToolHeader_h
#define ZWToolHeader_h
#define ALPHANUM @"0123456789"
#define GeneralRequest @"yanxi://GeneralRequest"
#define SearchHistoryKey @"userHistoryInfo"
#define UserInfoKey @"userInfo"
#define MAS_SHORTHAND
#define MAS_SHORTHAND_GLOBALS
#ifdef __OBJC__
// swift中随机颜色private lazy var randomColor : UIColor = UIColor.init(red: (CGFloat(arc4random_uniform(256)) / 255.0), green: (CGFloat(arc4random_uniform(256)) / 255.0), blue: (CGFloat(arc4random_uniform(256)) / 255.0), alpha: 1.0)
#define RandomColor [UIColor colorWithRed:((float)arc4random_uniform(256) / 255.0) green:((float)arc4random_uniform(256) / 255.0) blue:((float)arc4random_uniform(256) / 255.0) alpha:1.0]
#define iOS8 ([[UIDevice currentDevice].systemVersion floatValue] >= 8.0)
//#define ZWBaseUrl @"url"
#define WeakSelf(type)  __weak typeof(type) weak##type = type;

// 图片路径
/**
 @param kZWImageSrcName(file) 为通过copy文件夹方式获取图片路径的宏
 @param kZWImageFrameworkSrcName(file) 为通过cocoapods下载安装获取图片路径的宏
 @param kZWLoginPageBundle 为获取xib/其它文件 Bundle路径
 @return 组件化开发专用
 */
#define kZWGetBundle [NSBundle bundleForClass:[self class]]

// 沙盒
#define kPathTemp                   NSTemporaryDirectory()
#define kPathDocument               [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]
#define kPathCache                  [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) objectAtIndex:0]
#define kPathSearch                 [kPathDocument stringByAppendingPathComponent:@"Search.plist"]

// 屏幕宽高
#define ZWScreenW [UIScreen mainScreen].bounds.size.width
#define ZWScreenH [UIScreen mainScreen].bounds.size.height
#define ZWScreenBounds [UIScreen mainScreen].bounds

#define iPhone6P ([UIScreen mainScreen].bounds.size.height == 736)
#define iPhone6 ([UIScreen mainScreen].bounds.size.height == 667)
#define iPhone5 ([UIScreen mainScreen].bounds.size.height == 568)
#define iPhone4 ([UIScreen mainScreen].bounds.size.height == 480)
// 屏幕比例
#define kIPhone6WidthRatio (ZWScreenW / 375)
#define kIPhone6HeightRatio (ZWScreenH / 667)

#define ZWFunc  NSLog(@"%s",__func__);
//DEBUG  模式下打印日志,当前行 并弹出一个警告
#ifdef DEBUG
#   define ZLog(fmt, ...)  { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:[NSString stringWithFormat:@"%s\n [Line %d] ", __PRETTY_FUNCTION__, __LINE__] message:[NSString stringWithFormat:fmt, ##__VA_ARGS__]  delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil]; [alert show]; }
#else
#   define ZLog(...)
#endif


//根据RGB生成颜色
#define ZWGlobalGrayColor ZWColor(215, 215, 215, 1.0);
#define ZWColor(r,g,b,a) [UIColor colorWithRed:(r) / 255.0 green:(g) / 255.0 blue:(b) / 255.0 alpha:(a)]
// 固定控件尺寸
#define ZWNavH 64
#define ZWTabBarH 49
#define ZWTableVInset 35
// keyWindow
#define ZWkeyWindow [UIApplication sharedApplication].keyWindow
// 是否第一次登录
#define kIsFirstLauchApp @"kIsFirstLauchApp"

// 自定义log
#ifdef DEBUG  // 调试/测试模式

#define ZWLog(...) NSLog(__VA_ARGS__)

#else   // app发布

#define ZWLog(...)

#endif

//共有头文件 由用户自定义
#import "CalculteTextLength.h"
#import "CheckDataTool.h"
#import "CustomButton.h"
#import "FingerWaveView.h"
#import "GetBundle.h"
#import "IdentityInfoModel.h"
#import "ScrollingView.h"
#import "UIBarButtonItem+navItem.h"
#import "UIButton+addTouchArea.h"
#import "UIButton+TimerBtn.h"
#import "UIControl+TapInterval.h"
#import "UIImage+Image.h"
#import "UIImageView+BlurEffect.h"
#import "UITextField+Extension.h"
#import "UITextField+LimitLength.h"
#import "UITextField+ZWPlaceholder.h"
#import "UIView+Frame.h"
#import "UserHistoryManager.h"
#import "UserInfoManager.h"
#import "ZWAttributeStr.h"
#import "UIColor+RGBColor.h"

#endif
#endif /* ZWToolHeader_h */
